// Defector variant for Y / Master Y / Y Hex board (define "Side1" (union (sites Side NE) (sites Side N))) (define "Side2" (union (sites Side SE) (sites Side S))) (define "Side3" (union (sites Side NW) (sites Side SW))) (define "MoverLimit" (count Pieces Mover in:(sites Around (to) Orthogonal)) ) (define "AddToEmpty" (move Add (to (sites Empty)) #1 )) (define "DefectorMove" (priority (move Add (to (sites Occupied by:Next) if:(< "MoverLimit" (count Pieces Next in:(sites Around (to) Orthogonal))) (apply (remove (to))) ) (then (moveAgain) )) ("AddToEmpty" ~) )) //--------------------------------------------- // Main routine (game "Defector Y" (players 2) (equipment { (board use:Vertex) (piece "Disc" Each ) (piece "Counter" Neutral maxState:2) } ) (rules (play (if ("DefectorMove") (priority ("AddToEmpty" (then (moveAgain))) ("DefectorMove") ))) (end { (if ("IsConnectedPlayer") (result Mover Win) ) } ))) //----------------------------- //Scoring (define "IsConnectedPlayer" (is Connected 3 {"Side1" "Side2" "Side3"}) ) //------------------------------------------------- // Options (option "Board" args:{ } { (item "Triangle 5" <(tri 5)> "Triangle-5 Board (15)") (item "Triangle 6" <(tri 6)> "Triangle-6 Board (21)") (item "Triangle 8*" <(tri 8)> "Triangle-8 Board (36)")** (item "Triangle 9" <(tri 9)> "Triangle-9 Board (45)") (item "Triangle 11" <(tri 11)> "Triangle-11 Board (66)") (item "Triangle 12" <(tri 12)> "Triangle-12 Board (78)") (item "Triangle 14" <(tri 14)> "Triangle-14 Board (105)") (item "Triangle 15*" <(tri 15)> "Triangle-15 Board (120)")** (item "Triangle 17" <(tri 17)> "Triangle-17 Board (153)") (item "Hex 3-4" <(tri Limping 3)> "Hex 4-5 Board (48)") (item "Hex 4-5*" <(tri Limping 4)> "Hex 4-5 Board (48)")*** (item "Hex 5-6" <(tri Limping 5)> "Hex 5-6 Board (75)") (item "Hex 6-7*" <(tri Limping 6)> "Hex 6-7 Board (108)")** (item "Hex 7-8" <(tri Limping 7)> "Hex 7-8 Board (146)") (item "Hex 8-9" <(tri Limping 8)> "Hex 8-9 Board (146)") (item "Tiangle 7-7" <(renumber (rotate 90 (trim (remove (tri Limping 7) vertices:{2 3 4 5 6 7 8 12 13 14 15 16 17 23 24 25 26 27 28 35 36 37 38 39 48 49 50 51 52 62 63 64 65 77 78 79 90 91 101 102 103 111 112 113 120 121 122 123 128 129 130 131 135 136 137 138 139 141 142 143 144 145 146} ))))> "Triangle Board (83 turns)" ) } ) (option "Protocol" args:{} { (item "Alternating" "Alternating") (item "Turns 122*" <(or (> 0 (counter)) "SameTurn")> "Turns 122*") } ) //------------------------------------- (define "P1Colour" (colour DarkGreen)) (define "P2Colour" (colour White)) (define "BoardColour" (colour 215 203 170)) (define "EdgesOfSide" (intersection (sites Outer Edge) (forEach of:(difference #1 (sites Corners Vertex)) (sites Incident Edge of:Vertex at:(site)) ))) //--------------------------------------------- (metadata (info { (description "Defector Y is a Y variant based on replacing overcrouded opponent's pieces with your own before your placement. Defection has the effect that completing a single Y fork must be deferred until the opponent is nearby, and thus the opponent can easily sever a fork that is set in an open area of the board. There are also occasions where one offers a defection in order to obtain a nearby defection in return, or to prevent an opponent blocking a critical location, or to allow your own safe play into such a location. The effect also is to cause the board to fill considerably before a win, and to create more contorted connection paths.") (rules "Goal: Connect all three edge colors with a single group of connected stones of your own color. (As in 'Y') Turns alternate. The player seeking to connect with the darker color starts. The turns consist of two parts: a conditional conversion of stones in the vicinity of the last placement, followed by one's own placement. The conversion part requires one to examine the opponent's stones around (and including) the last placed stone. Then to convert into your own, any that are surrounded by more of their own color than of yours. This is done one-by-one in any desired order, until the condition no longer applies. When no stone has more friendly neighbors than enemy neighbors, the current player places a new stone onto any empty location. The first player to connect all 3 sides is the winner. If the 122* turn protocol option is selected, the turn begins and ends with a placement, and the conversions occur in between.") (id "3974") (version "1.3.12") (classification "board/space/connection") (author "Dale W. Walton") (credit "Dale W. Walton") (date "11-03-2023") } ) (graphics { (player Colour P1 "P1Colour") (player Colour P2 "P2Colour") (board StyleThickness OuterEdges 4.0) (region Colour Edge ("EdgesOfSide" "Side1") regionSiteType:Edge (colour Red)) (region Colour Edge ("EdgesOfSide" "Side2") regionSiteType:Edge (colour Blue)) (region Colour Edge ("EdgesOfSide" "Side3") regionSiteType:Edge (colour Yellow)) (board Style Board) (board Colour Phase0 "BoardColour") (board Colour InnerEdges (colour 120 100 40 190) ) (board Colour OuterEdges (colour 120 100 40 190) ) (piece Scale .7) } ))